package com.bjpowernode.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bjpowernode.mapper.UsersMapper;
import com.bjpowernode.domain.User;
import com.bjpowernode.service.UserService;

import javax.annotation.Resource;

@Service
public class UserServiceImpl extends ServiceImpl<UsersMapper, User> implements UserService{
    @Resource
    private UsersMapper usersMapper;

    /**
     * 验证账户密码是否正确
     *
     * @param username
     * @return
     */
    @Override
    public User findUserName(String username) {
        // selectOne是查一个 selectList是查一个集合
        return usersMapper.selectOne(new LambdaQueryWrapper<User>()
        .eq(User::getUsername,username));
    }
}
